import request from "@/utils/request";

// /admin/acl/role/{page}/{limit} 获取角色数据
export const reqGetRoles = (page, limit, searchObj) =>
  request({
    url: `/admin/acl/role/${page}/${limit}`,
    method: "get",
    params: searchObj,
  });

// 修改角色 /admin/acl/role/update  put
export const reqUpdateRole = (role) =>
  request({
    url: `/admin/acl/role/update`,
    data: role,
    method: "put",
  });

// 删除角色　/admin/acl/role/remove/{id}　delete
export const reqDeleteRole = (id) =>
  request({
    url: `/admin/acl/role/remove/${id}`,
    method: "delete",
  });

// 根据id列表删除角色 /admin/acl/role/batchRemove  delete
export const reqDeleteAllRoles = (idList) =>
  request({
    url: "/admin/acl/role/batchRemove",
    method: "delete",
    data: idList,
  });

// 新增角色 /admin/acl/role/save post
export const reqAddRole = (role) =>
  request({
    url: "/admin/acl/role/save",
    method: "post",
    data: role,
  });
